import { defineStore } from 'pinia'

export const useTokenStore = defineStore('token', {
  persist: {
    enabled: true
  },
  state: () => {
    return {
      token: null as string | null
    }
  },
  actions: {
    setToken(token: string) {
      this.$state.token = token
    },
    delToken() {
      this.$state.token = null
    }
  }
})
